import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'home',
      component: () => import('../views/HomePage/index.vue'),
    },
    {
      path: '/category',
      name: 'category',
      component: () => import('../views/CategoryPage/index.vue'),
    },
    {
      path: '/cartPage',
      name: 'cartPage',
      component: () => import('../views/CartPage/index.vue'),
    },
    {
      path: '/userCenter',
      name: 'userCenter',
      component: () => import('../views/UserCenter/index.vue'),
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'not-found',
      component: () => import('../views/NotFound.vue'),
    },
  ],
})

export default router
